View Issue Details

IDProjectCategoryView StatusLast Update
0001774K18X001.00 SKB SWANSWpublic2023-07-25 09:27
Reporter(ALTech) Sangmin Choi Assigned To(ALTech) Sangmin Choi Due Date2023-07-24 19:00
PrioritynormalSeveritys4-minorReproducibilityN/A
Status closedResolutionfixed 
Summary0001774: Please apply this patch from BPM-20078.
DescriptionHi, Jason,

Please apply this patch from BPM-20078.

1.
vendor/synaptics/btv-hal-impl/synaptics

CSMSKBSBLT-216-thread-lock.patch
CSMSKBSBLT-216-Remove-stop-start_v3_alt.patch

Commit Message :
[BPM-20078]
The root cause is internal state error
for example, state was not stopped but tried to clean buffer.
in order to avoid such a situation.
added thread lock start and stop.
remove internal start and stop calling, which will conflict with upper layer call.

Thank you.
Sangmin Choi.
TagsNo tags attached.
Attach Tags

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

(ALTech) Sangmin Choi

2023-07-24 15:22

developer  

CSMSKBSBLT-216-thread-lock.patch (3,124 bytes)   
diff --git a/hal_av_pipeline.c b/hal_av_pipeline.c
index 123d54e..fdaa2f6 100644
--- a/hal_av_pipeline.c
+++ b/hal_av_pipeline.c
@@ -39,6 +39,8 @@ synaptics_player_info gSocPlayerInfo[2];
 			
 pthread_t p_thread_decoder_statistics;
 pthread_mutex_t  thread_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t  main_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t  pip_mutex = PTHREAD_MUTEX_INITIALIZER;
 pthread_cond_t   thread_cond  = PTHREAD_COND_INITIALIZER;
 bool isDestroy = true;
 bool isStop = true;
@@ -250,7 +252,13 @@ int  AVP_Start(AVP_HANDLE player, AVP_PlayerConfig *config) {
     ALOGD("BTF|%s|%d|IN| player=%x, vcodec=%d, acodec=%d, pcr_pid=%d, video_pid=%d, audio_pid=%d \n", __FUNCTION__,__LINE__, player, config->video_codec, config->audio_codec, config->pcr_pid, config->video_pid, config->audio_pid);
 
     synaptics_player_info *socPlayerInfo = (synaptics_player_info *) player;
-    socPlayerInfo->playerConfig = *config;
+    socPlayerInfo->playerConfig = *config;
+
+    if( socPlayerInfo->pip ){
+        pthread_mutex_lock(&pip_mutex);
+    }else{
+        pthread_mutex_lock(&main_mutex);
+    }
 	
 	// check decoder error
 	socPlayerInfo->decoder_errors_num_adec = 0;
@@ -320,6 +328,13 @@ int  AVP_Start(AVP_HANDLE player, AVP_PlayerConfig *config) {
 	} else ALOGE("BTF|%s|%d|IN| load volume fail", __FUNCTION__,__LINE__);
 	
 	startCheckDecoderStatistics(player);
+
+    if( socPlayerInfo->pip ){
+        pthread_mutex_unlock(&pip_mutex);
+    }else{
+        pthread_mutex_unlock(&main_mutex);
+    }
+
 
     ALOGD("BTF|%s|%d|OUT| \n", __FUNCTION__,__LINE__);
 
@@ -332,6 +347,12 @@ int  AVP_Stop(AVP_HANDLE player) {
     CHECK_NULL_PLAYER(player);
 
     synaptics_player_info *socPlayerInfo = (synaptics_player_info *) player;
+
+    if( socPlayerInfo->pip ){
+        pthread_mutex_lock(&pip_mutex);
+    }else{
+        pthread_mutex_lock(&main_mutex);
+    }
 	
 	stopCheckDecoderStatistics();
 
@@ -359,7 +380,13 @@ int  AVP_Stop(AVP_HANDLE player) {
     if(logFp[socPlayerInfo->pip ? 1:0] != NULL)
         fclose(logFp[socPlayerInfo->pip ? 1:0]);
 #endif
-
+
+    if( socPlayerInfo->pip ){
+        pthread_mutex_unlock(&pip_mutex);
+    }else{
+        pthread_mutex_unlock(&main_mutex);
+    }
+
     ALOGD("BTF|%s|%d|OUT| \n", __FUNCTION__,__LINE__);
 
 	return 0;
@@ -454,6 +481,13 @@ int  AVP_FlushTS(AVP_HANDLE player) {
     ALOGD("BTF|%s|%d|IN| player=%x\n", __FUNCTION__,__LINE__, player);
 
     synaptics_player_info *socPlayerInfo = (synaptics_player_info *) player;
+
+    if( socPlayerInfo->pip ){
+        pthread_mutex_lock(&pip_mutex);
+    }else{
+        pthread_mutex_lock(&main_mutex);
+    }
+
     amp_stop_pipeline(player);
 
     amp_clear_port_buf(player);
@@ -463,7 +497,13 @@ int  AVP_FlushTS(AVP_HANDLE player) {
     amp_reset_buffer(socPlayerInfo);
 
     amp_start_pipeline(player);
-
+
+    if( socPlayerInfo->pip ){
+        pthread_mutex_unlock(&pip_mutex);
+    }else{
+        pthread_mutex_unlock(&main_mutex);
+    }
+
     ALOGD("BTF|%s|%d|OUT| \n", __FUNCTION__,__LINE__);
 
 	return 0;
CSMSKBSBLT-216-Remove-stop-start_v3_alt.patch (2,313 bytes)   
diff --git a/amp_wrapper.c b/amp_wrapper.c
old mode 100644
new mode 100755
index 1d37629..fc976cc
--- a/amp_wrapper.c
+++ b/amp_wrapper.c
@@ -51,8 +51,6 @@ void amp_log(int device, char *log) {
 
 void amp_reset_buffer(synaptics_player_info *socPlayerInfo);
 INT64 amp_iptv_mgr_get_position(AVP_HANDLE *player);
-void amp_stop_pipeline(AVP_HANDLE *player);
-void amp_start_pipeline(AVP_HANDLE *player);
 
 int amp_check_nugu_enabled(){
     char nugu_enabled[PROP_VALUE_MAX];
@@ -388,9 +386,6 @@ HRESULT vdec_user_data_cb(CORBA_Object hCompObj, AMP_PORT_IO ePortIo,
     return SUCCESS;
 }
 
-void amp_start_pipeline(AVP_HANDLE *player);
-void amp_stop_pipeline(AVP_HANDLE *player) ;
-
 HRESULT amp_dmx_event_handler(HANDLE hListener, AMP_EVENT *pEvent, VOID *pUserData) {
     AVP_HANDLE *player = (AVP_HANDLE *)pUserData;
 
@@ -409,6 +404,12 @@ HRESULT amp_dmx_event_handler(HANDLE hListener, AMP_EVENT *pEvent, VOID *pUserDa
             ALOGD("++amp_dmx_event_handler AMP_EVENT_DMX_INBUFF_OVERFLOW (handle=0x%x, fulness=0x%x, size=0x%x)",
                                        pBuffState->hHandle, pBuffState->uFullness, pBuffState->uSize );
 
+            AVP_MediaCallback function = socPlayerInfo->createConfig.function;
+            if(function != NULL && player != NULL) {
+                ALOGD("[%s] AMP_EVENT_DMX_INBUFF_OVERFLOW reset tune ", __FUNCTION__);
+                int event = AVP_DECODER_ERROR_BUFFER_FULL;
+                function(AVP_DECODER_ERROR, &event, sizeof(int), socPlayerInfo->createConfig.callback_user_param);
+            }
         } break;
     case AMP_EVENT_DMX_INBUFF_UNDERFLOW:
         {
@@ -2494,15 +2495,13 @@ HRESULT clk_pause_resume(AVP_HANDLE *player, BOOL enable) {
     if (TRUE == enable) {
         // pause
         //AMP_RPC(ret, AMP_CLK_SetState, socPlayerInfo->amp_clk, AMP_PAUSED);
-        amp_stop_pipeline(player);
-        //AMP_RPC(ret, AMP_CLK_SetState, socPlayerInfo->amp_clk, AMP_IDLE);
         ALOGD("clk_pause_resume Video Paused\n");
+        amp_pause_pipeline(player);
     } else {
-
-        amp_start_pipeline(player);
         // Resume
         //AMP_RPC(ret, AMP_CLK_SetState, socPlayerInfo->amp_clk, AMP_EXECUTING);
         ALOGD("clk_pause_resume Video Resumed\n");
+        amp_resume_pipeline(player);
     }
 
     return ret;

(ALTech) Sangmin Choi

2023-07-24 15:23

developer   ~0013680

Hello, Jason,

Could you please check this ticket?

Thank you.
Sangmin Choi.

(SW) Jason Ling

2023-07-24 15:47

developer   ~0013682

Hi Sangmin,

Which branch ?

Thanks,
Jason

(ALTech) Sangmin Choi

2023-07-24 16:12

developer   ~0013684

Hello, Jason,

540 main branch.

(SW) Jason Ling

2023-07-24 17:36

developer   ~0013686

Hi Sangmin,

Done

2023-07-24 17:34:44 | jason.tf.ling@fii-.. | cdcc53e | vendor/synaptics/btv-hal-impl/synaptics | [BPM-20078] The root cause is internal state error for

Thanks,
Jason

(ALTech) Sangmin Choi

2023-07-25 09:27

developer   ~0013710

Hello, Jason,

Thank you for support.

Best Regards,
Sangmin Choi.

Issue History

Date Modified Username Field Change
2023-07-24 15:22 (ALTech) Sangmin Choi New Issue
2023-07-24 15:22 (ALTech) Sangmin Choi Status new => assigned
2023-07-24 15:22 (ALTech) Sangmin Choi Assigned To => (SW) Jason Ling
2023-07-24 15:22 (ALTech) Sangmin Choi File Added: CSMSKBSBLT-216-thread-lock.patch
2023-07-24 15:22 (ALTech) Sangmin Choi File Added: CSMSKBSBLT-216-Remove-stop-start_v3_alt.patch
2023-07-24 15:23 (ALTech) Sangmin Choi Note Added: 0013680
2023-07-24 15:47 (SW) Jason Ling Note Added: 0013682
2023-07-24 16:12 (ALTech) Sangmin Choi Note Added: 0013684
2023-07-24 17:36 (SW) Jason Ling Assigned To (SW) Jason Ling => (ALTech) Sangmin Choi
2023-07-24 17:36 (SW) Jason Ling Status assigned => resolved
2023-07-24 17:36 (SW) Jason Ling Resolution open => fixed
2023-07-24 17:36 (SW) Jason Ling Note Added: 0013686
2023-07-25 09:27 (ALTech) Sangmin Choi Note Added: 0013710
2023-07-25 09:27 (ALTech) Sangmin Choi Status resolved => closed